<div class="lg_border2 w680" style="margin: 0px;width:376px;margin-bottom: 10px;float:left;<?php echo $i % 2 == 0 ? 'margin-right: 10px' : '' ?>">
  <div class="title" style="width:362px">
    <a style="color:white" title="<?php echo $promotion['title'] ?>"
       href="<?php echo site_url('promotion/show/' . $promotion['id'] . '/' . str_nice_name($promotion['title'])) ?>">
      <?php echo strlen($promotion['title']) > 40 ? substr($promotion['title'], 0, 40) . ' ...' : $promotion['title'] ?></a>
  </div>
  <div style="width: 356px">
    <div class="cpos_1" style="margin-right:5px;float:left;position: relative">                  
      <div id="slideshow_<?php echo $promotion['id'] ?>" class="slideshow">
        <?php if (empty($promotion['medias'])) { ?>
          <a href="<?php echo site_url('promotion/show/' . $promotion['id'] . '/' . str_nice_name($promotion['title'])) ?>">                    
            <img width="376px" height="250px" 
                 src="<?php echo site_url('admin/promotion_media/preview') ?>" alt=""/>                    
          </a>
          <?php
        } else {
          foreach ($promotion['medias'] as $media) {
            ?>
            <a href="<?php echo site_url('promotion/show/' . $promotion['id'] . '/' . str_nice_name($promotion['title'])) ?>">                    
              <img width="376px" height="250px" 
                   src="<?php echo site_url('admin/promotion_media/preview/' . $media['id']) ?>" alt=""/>                    
            </a>
            <?php
          }
        }
        ?>
      </div>
      <div style="z-index: 1000;width: 376px;height:100px;position:absolute;bottom:0px;left: 0px" 
           class="bg_transparent">
        <div style="font-size: 12px; float: left; text-align: left;width:232px;margin-bottom: 2px">
          <div style="width: 50%;float:left;text-align: center">
            <span style="color: white;"><?php echo $this->lang->line('front-end.label.promotion.available') ?></span><br/>
            <span style="font-weight: bold;font-size: 180%;color: red;"><?php echo $promotion['remain'] ?></span>          
          </div>
          <div style="width: 50%;float:left;text-align: center">          
            <span style="color: white"><?php echo $this->lang->line('front-end.label.promotion.number.got') ?></span><br/>
            <span style="font-weight: bold;font-size: 180%;color: red"><?php echo $promotion['num_got'] ?></span>
          </div>
        </div>        
        <div class="button_download" style="float: right;margin-top:5px;margin-right: 1px;">
          <a href="<?php echo site_url('promotion/download/' . $promotion['id'] . '/' . str_nice_name($promotion['title'])) ?>"></a>
        </div>
        <div style="width: 200px;color: red;font-size: 25px;float:left;margin-left:25px;margin-bottom: 3px" 
             id="remain_time_<?php echo $promotion['id'] ?>">
          <div id="wrapping">
            <div id="clock-ticker" class="clearfix">
              <div class="block">
                <footer class="label">Days</footer>
                <span class="flip-top" id="numdays">00</span>
                <span class="flip-btm">&nbsp;</span>                            
              </div>

              <div class="block">
                <footer class="label">Hours</footer>
                <span class="flip-top" id="numhours">00</span>
                <span class="flip-btm">&nbsp;</span>                            
              </div>

              <div class="block">
                <footer class="label">Mins</footer>
                <span class="flip-top" id="nummins">00</span>
                <span class="flip-btm">&nbsp;</span>                            
              </div>

              <div class="block">
                <footer class="label">Secs</footer>
                <span class="flip-top" id="numsecs">00</span>
                <span class="flip-btm">&nbsp;</span>                            
              </div>
            </div>
          </div>
        </div>
        <div class="mg20" style="margin-top:1px;text-align: center;width: 100%;float:left;">
          <div style="width: 100px;height: 20px;float: left">
            <img id = "share_button<?php echo $promotion['id'] ?>"
                 src = "<?php echo base_url() . APPPATH ?>themes/user/img/share_button.png"/>
            <script>
              $(document).ready(function(){
                $('#share_button<?php echo $promotion['id'] ?>').click(function(e){
                  e.preventDefault();
                  FB.ui({
                    method: 'feed', name: '<?php echo $promotion['title'] ?>',
                    link: '<?php echo site_url('promotion/show/' . $promotion['id'] . '/' . str_nice_name($promotion['title'])) ?>',
                    picture: '<?php echo site_url('admin/promotion_media/preview_promotion/' . $promotion['id']) ?>',
                    caption: '<?php echo $promotion['title'] ?>',
                    description: "<?php echo trim(strip_tags($promotion['description'])) ?>", 
					message: ''
                  });
                });
              });
            </script> 
          </div>
          <div style="width: 125px;height: 20px;float: left">
            <div class="fb-like" data-send="false" data-layout="button_count" data-width="100" data-show-faces="true"
                 data-href="<?php echo site_url('promotion/show/' . $promotion['id'] . '/' . str_nice_name($promotion['title'])) ?>"></div>                      
          </div>
          <div style="width: 100px;height: 20px;float: left">
            <a href="https://twitter.com/share" class="twitter-share-button" style="float:right;"
               data-url="<?php echo site_url('promotion/show/' . $promotion['id'] . '/' . str_nice_name($promotion['title'])) ?>" 
               data-text="<?php echo $promotion['title'] ?>" data-via="iFreeListings">Tweet</a>		
          </div>                                           
        </div>
      </div>
    </div>
    <!--    <div class="center cpos_2 promotion_box"></div>-->
  </div>
  <div class="clearer"></div> 
</div>